package lab_2;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author grp02 - Pascal Charreix and Meike Paetz
 *
 * The Invoice class which implements Serializable, represents an Invoice.
 */
public class Invoice implements Serializable {

    private int invoiceNumber;
    private String customerName;
    private String travelAgencyName;
    private int holidayPackageID;
    private float price;
    private Date paymentDate;
    private boolean paid;

    /**
     *
     * creates an Invoice
     */
    public Invoice(int Number, String custName, String agencyName, int packID, float amount, Date date) {
        invoiceNumber = Number;
        customerName = custName;
        travelAgencyName = agencyName;
        holidayPackageID = packID;
        price = amount;
        paymentDate = date;
        paid = false;
    }

    /**
     *
     * returns information of an invoice via a String
     */
    public String getInvoiceInformation() {
        return "Invoice Number : " + String.valueOf(invoiceNumber)
                + "\nCustomer Name : " + customerName
                + "\nTravel Agency  : " + travelAgencyName
                + "\nHoliday Package ID : " + String.valueOf(holidayPackageID)
                + "\nPrice : " + String.valueOf(price)
                + "\nDue date : " + paymentDate.toString();
    }

    /**
     *
     * returns the invoice number
     */
    public int getInvoiceNumber() {
        return invoiceNumber;
    }

    /**
     *
     * returns customers' name
     */
    public String getCustomerName() {
        return customerName;
    }

    /**
     *
     * returns travel agencies' name
     */
    public String getTravelAgencyName() {
        return travelAgencyName;
    }

    /**
     *
     * returns the ID of a holiday package
     */
    public int getHolidayPackageID() {
        return holidayPackageID;
    }

    /**
     *
     * returns the price of a holiday package
     */
    public float getPrice() {
        return price;
    }

    /**
     *
     * returns the date of payment
     */
    public Date getPaymentDate() {
        return paymentDate;
    }

    /**
     *
     * returns state whether package is paid or not
     */
    public boolean isPaid() {
        return paid;
    }

    /**
     *
     * sets payment state to true
     */
    public void payment() {
        paid = true;
    }
}
